/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.anachronos.jeep.model.trace.impl;

import java.util.Collection;

import org.anachronos.jeep.model.trace.MergedSqlStatementExecutionsType;
import org.anachronos.jeep.model.trace.SqlStatementExecution;
import org.anachronos.jeep.model.trace.TracePackage;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Merged Sql Statement Executions Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.anachronos.jeep.model.trace.impl.MergedSqlStatementExecutionsTypeImpl#getMergedSqlStatementExecutions <em>Merged Sql Statement Executions</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class MergedSqlStatementExecutionsTypeImpl extends EObjectImpl implements MergedSqlStatementExecutionsType {
	/**
	 * The cached value of the '{@link #getMergedSqlStatementExecutions() <em>Merged Sql Statement Executions</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMergedSqlStatementExecutions()
	 * @generated
	 * @ordered
	 */
	protected EList<SqlStatementExecution> mergedSqlStatementExecutions;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected MergedSqlStatementExecutionsTypeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return TracePackage.Literals.MERGED_SQL_STATEMENT_EXECUTIONS_TYPE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<SqlStatementExecution> getMergedSqlStatementExecutions() {
		if (mergedSqlStatementExecutions == null) {
			mergedSqlStatementExecutions = new EObjectContainmentEList<SqlStatementExecution>(SqlStatementExecution.class, this, TracePackage.MERGED_SQL_STATEMENT_EXECUTIONS_TYPE__MERGED_SQL_STATEMENT_EXECUTIONS);
		}
		return mergedSqlStatementExecutions;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case TracePackage.MERGED_SQL_STATEMENT_EXECUTIONS_TYPE__MERGED_SQL_STATEMENT_EXECUTIONS:
				return ((InternalEList<?>)getMergedSqlStatementExecutions()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case TracePackage.MERGED_SQL_STATEMENT_EXECUTIONS_TYPE__MERGED_SQL_STATEMENT_EXECUTIONS:
				return getMergedSqlStatementExecutions();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case TracePackage.MERGED_SQL_STATEMENT_EXECUTIONS_TYPE__MERGED_SQL_STATEMENT_EXECUTIONS:
				getMergedSqlStatementExecutions().clear();
				getMergedSqlStatementExecutions().addAll((Collection<? extends SqlStatementExecution>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case TracePackage.MERGED_SQL_STATEMENT_EXECUTIONS_TYPE__MERGED_SQL_STATEMENT_EXECUTIONS:
				getMergedSqlStatementExecutions().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case TracePackage.MERGED_SQL_STATEMENT_EXECUTIONS_TYPE__MERGED_SQL_STATEMENT_EXECUTIONS:
				return mergedSqlStatementExecutions != null && !mergedSqlStatementExecutions.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //MergedSqlStatementExecutionsTypeImpl
